在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):kelyvin/ghost-caffeine-theme开源软件地址(OpenSource Url):https://github.com/kelyvin/ghost-caffeine-theme开源编程语言(OpenSource Language):SCSS 40.7%开源软件介绍(OpenSource Introduction):Caffeine ThemeRead before useThank you so much for your support and contributions for the past 6+ years. The Ghost Foundation has evolved immensely in the past several years and their current collection of free/paid themes have gone a lot further than when I originally started this project. Because of this and a shift of personal priorities, I will no longer be actively developing this theme and any future updates will no longer be coming from me. I will still try to merge in a PR every now and then, and if anyone is passionate about continuing support, plesae reach out to me and I can make you a contributor. Thank you again for your years of support! IntroductionCaffeine Theme is a Material Design inspired theme for the Ghostpublishing platform. It originally began as a fork of Uno-Zen, but has since been drastically changed. Huge thanks to the original creator for the original theme layout and inspiration. The theme is super easy to configure, with almost no code change necessary! Simply follow the customization options below. You can check out the theme in action on my official blog Caffeine Coding Ghost Versions SupportThis theme has been upgraded to Note: because this theme maintains a certain style, you will not be able to take advantage of the Image Size Options of Ghost v2. If you'd like to have more image sizing options, please provide a potential solution (that works well with the design) and make a pull request. Table of Contents
Theme FeaturesBecause Caffeine Theme draws inspiration from Material design practices, you'll see familiar design patterns throughout the theme, such as cards, several buttons, etc. Like the original Uno-zen theme that helped provide the skeleton for this project, there may still be some shared similiaries with the original project. However, there are some vast changes as well, especially around the mobile experience and animation logic. The following is a list of key differences that include, but are not limited to:
InstallationYou can install this theme in one of three ways, but the last two options require Option 1Download the latest release on Github, download the zip, extract the folder, and paste it into your theme folder ( Option 2Enter the theme folder ( $ git clone https://github.com/kelyvin/caffeine-theme Option 3If you have your Ghost blog hosted on git and you want to continuously get the latest updates, you can add this repo as a submodule. Create a Add JQuery and other librariesThis theme needs jQuery to work, but jQuery is not provided by the theme. Instead, you need to inject it into the <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> In addition, this theme also takes advantage of Masonry to provide a nicer grid layout and Scroll Reveal for sleek scrolling animations. These are not mandatory and fallbacks are also provided for both. If you would like these feature(s), inject the following code as well. (Note: imagesloaded is not necessary, but recommended for smooth masonry layouts). <script type="text/javascript" src="https://unpkg.com/[email protected]/imagesloaded.pkgd.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/masonry.pkgd.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/scrollreveal.js/3.0.9/scrollreveal.min.js"></script> At the end, it should probably look something like this: CustomizationsAs mentioned earlier, this theme is very easily configurable to suit your needs. Every feature of the theme that you can easily customize will be listed below. General SettingsMake sure to set up some of your default settings within your Ghost Admin panel → Number of PostsWith ghost migrating to v1, to set the number of posts per page, you'll have to configure a file within the theme directly. The configuration is set within the "config": {
"posts_per_page": 6
} Header iconOn every page there is an icon on the upper-left hand corner that will open the splash screen. If you'd rather set your own icon, overwrite the <img src="{{@site.logo}}" alt="{{@site.title}} avatar" class="avatar rounded hvr-buzz-out" /> and delete the following line: <img src="{{asset "img/icons/icon.png"}}" alt="{{@site.title}} icon" class="icon rounded hvr-buzz-out" /> FaviconsCreate your favicons with Favicon Generator and place them in in Tags OverlayTo purpose of the tags overlay is to display a list of popular tags that you want your users to easily find and navigate to. You can continuously add to this list to create an "infinite" list of tags. Go to Ghost Admin panel → <script>
var tag_names = ['code', 'career'];
</script> Note: Ghost currently does not have a "production" ready feature to easily find your list of tags, so this is the temporary solution until that feature is more broadly supported. Google AnalyticsGo to Ghost Admin panel → <script>
var ga_id = 'UA-YOUR_ID_HERE';
</script> Disqus CommentsGo to Ghost Admin panel → <script>
var disqus_shortname = 'YOUR_DISQUS_SHORTCUT_HERE';
</script> Masonry Grid Layout (beta)By default this theme will create a two column grid layout if you decided to import the Masonry package as described in the instructions above. If you didn't import the package, the theme will render a single column grid. You can customize the number of columns you'd like your home page to render by simply specifying the number in the following option. Go to Ghost Admin panel → <script>
var gridOptions = {
columns: 3
};
</script> This will change the theme to use a 3 column grid. Feel free to experiment the grid columns with the number of posts you want to show on each page to get the experience that you want! Note: This feature is still somewhat experimental and you may see some jumpy animations MailchimpThis theme easily enables you to create a Mailchimp subscription sign-up. We are using Hello Byte's subbscribe library to create an opt-in popup form. Due to its lack of support for a package manager, I have included its assets as part of this project. I will try to keep that updated regularly as needed. To enable this feature, you'll need to obtain your Mailchimp embed signup form action URL, which is documented here. Then inject it into your blog header like the example below. Go to Ghost Admin panel → <script>
var mailchimpOptions = {
url: "//1bytebeta.us9.list-manage.com/subscribe/post?u=1c261e60d8259c0c636801494&id=7fa99bf359"
};
</script> You must set the var mailchimpOptions = {
url: "//1bytebeta.us9.list-manage.com/subscribe/post?u=1c261e60d8259c0c636801494&id=7fa99bf359",
title: "Never miss a post!",
text: "Stay up to the date with the latest posts from Caffeine Coding!",
name: "<a href='https://www.facebook.com/caffeinecoding' target='_blank'>@caffeinecoding</a>",
color: "#56817A",
thumbnail: "http://i.imgur.com/39erIwp.png"
}; Toast NotificationsThis theme has support with toastr to create custom notifications on your blog for your users to see. You can configure the notification through the Ghost admin panel, as seen in the example below: Go to Ghost Admin panel → <script>
var notificationOptions = {
type: "info",
message: "I want to show this message",
isShownOnce: true,
escapeHtml: false
};
</script> The Note: CoverGo to Ghost Admin panel → General → Cover titleBy default, the title that you see in the cover page of your blog is extracted from your blog settings (Admin panel → Blog Title). If you want to customize it, you can do it like so: Go to Ghost Admin panel → <script>
var profile_title = 'Caffeine Theme';
</script> Cover subtitleThe purpose of the subtitle is to describe your bio in a quick phrase. Go to Ghost Admin panel → <script>
var profile_resume ='Software Engineer';
</script> Disable CoverIf you'd like to disable the cover and go directly to the home page, you can simply add the following code to the code injection. Go to Ghost Admin panel → <script>
var disableCover = true;
</script> LinksGo to Ghost Admin panel → The "Home" link is always included by default, so you don't need to add it manually. Browser Compatibility PageThis theme includes a special browser compatibility page for users who use IE9 and below. You can enable it by creating a static page with the post url as Custom static pagesCheck out the official documentation on Ghost.org. Social NetworksTo manage your social networks, you'll need to provide a custom config option. For Facebook and Twitter links, go to Ghost Admin panel → General → <script>
var socialConfig = {
facebook: {
title: "Caffeine Coding on Facebook"
},
twitter: {
title: "@KelyvinN on Twitter"
},
linkedIn: {
link: "https://linkedin.com/in/kelyvin",
title: "Kelyvin on LinkedIn"
},
github: {
link: "https://github.com/kelyvin",
title: "Kelyvin on Github"
}
};
</script> If you don't provide a config for any of these, they will automatically be omitted. If you want other social links besides these four, you'll have to get your hands a little dirty. You can edit the file AMP SupportAs of Ghost v0.10.0, Ghost supports and will automatically render AMP (accelerated mobile pages) versions of your posts. You can read more about the AMP project here. Included in this theme is an For example, if you'd like to change the default header color to match your theme's default color, simply open up .main-header {
...
background: #56817A no-repeat center center;
...
} To see how the AMP version of a post looks, append Syntax highlight support for additional languagesPrism.js includes only some basic languages such as html, markdown, css and javascript. Add the Prism.js autoloader plugin to dynamically load additional languages. You need to inject it into the <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/components/prism-core.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/plugins/autoloader/prism-autoloader.js"></script>
<script>Prism.plugins.autoloader.languages_path = 'https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/components/'</script> Developing and ContributingThere may be a situation where you want to pull the code and modify the code directly, or you may even want to contribute! You may do this to simply change the base colors, add additional features, or even help me fix some bugs! Follow the instructions below on how to get started with this. File SystemThe code for the theme is divided into 3 main sections: static files (as HTML and images), CSS and JS. Check out the directory structure below:
Putting the files in context:
To bundle, minify, and compile the stylesheets and js files, we use Gulp, check BuildingFor local development you need to have to install some core node modules and have a locally running Ghost server. Assuming you already have Node and npm installed, follow the instructions to install Gulp. Run your Ghost server separately like this: npm start
Migrations: Up to date at version 004
Ghost is running in development...
Listening on 127.0.0.1:2368
Url configured as: http://localhost:2368
Ctrl+C to shut down Note that my local Ghost is running in the port With your local Ghost running, open another terminal and enter in the folder $ git clone https://github.com/kelyvin/c |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论