Coder Social home page Coder Social logo

fadillahalazmi2601 / type-on-strap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from misriadi0896/type-on-strap

0.0 1.0 0.0 44.32 MB

๐ŸŽจ Simplistic, responsive jekyll based open source theme

Home Page: https://sylhare.github.io/Type-on-Strap/

License: MIT License

Ruby 2.36% HTML 56.63% CSS 37.41% JavaScript 3.60%

type-on-strap's Introduction

Type on Strap Build Status

A free and open-source Jekyll theme. Based on Rohan Chandra type-theme with a few new features:

Demo

Default Type on Strap blog

Table of Contents

  1. Usage
  2. Struture
  3. Configure Type on Strap
  4. Layout
  5. Feature pages
  6. Template as a Gem
  7. License

Usage

  1. Fork and clone the Type on Strap repo: git clone https://github.com/Sylhare/Type-on-Strap.git
  2. Install Jekyll: gem install jekyll, check #1 if you have a problem.
  3. Install the theme's dependencies: bundle install
  4. Customize the theme
  5. Run the Jekyll server: jekyll serve

Structure

Here are the main files of the template

jekyll-theme-basically-basic
โ”œโ”€โ”€ _draft	               # To store your drafts, they won't be published on your site
โ”œโ”€โ”€ _includes	               # theme includes
โ”œโ”€โ”€ _layouts                   # theme layouts (see below for details)
โ”œโ”€โ”€ _portofolio	               # collection of article to be populated in the portfolio page
โ”œโ”€โ”€ _posts                     # Blog posts
โ”œโ”€โ”€ _sass                      # Sass partials 
โ”œโ”€โ”€ assets
|  โ”œโ”€โ”€ js	               # theme javascript, Katex, jquery, bootstrap, jekyll search, 
|  โ”œโ”€โ”€ css                     # isolated Bootstrap, font-awesome, katex and main css
|  โ”œโ”€โ”€ fonts		       # Font-Awesome, Glyphicon, and other fonts
|  โ””โ”€โ”€ img		       # Images used for the template
โ”œโ”€โ”€ pages
|   โ”œโ”€โ”€ 404.md		       # To be displayed when url is wrong
|   โ”œโ”€โ”€ about.md               # About example page
|   โ”œโ”€โ”€ portfolio.html	       # Portfolio bootstrapped page
|   โ”œโ”€โ”€ search.html	       # Search page
|   โ””โ”€โ”€ search.json            # Specify the search target (page, post, collection)
โ”œโ”€โ”€ _config.yml                # sample configuration
โ””โ”€โ”€ index.html                 # sample home page (blog page paginated)

Configure Type on Strap

Open _config.yml in a text editor to change most of the blog's settings.

If a variable in this document is marked as "optional", disable the feature by removing all text from the variable.

Site configuration

Configure Jekyll as your own blog or with a subpath in in _config.yml:

Jekyll website without a subpath (such as a GitHub Pages website for a given username):

  baseurl: ""
  url: "https://username.github.io"

Jekyll website with subpath (like the Type on Strap demo page):

  baseurl: "/sub-directory"
  url: "https://username.github.io/"

Please configure this before using the theme.

Meta and Branding

Meta variables hold basic information about your Jekyll site which will be used throughout the site and as meta properties for search engines, browsers, and the site's RSS feed.

Change these variables in _config.yml:

  theme_settings:
    title: My Jekyll Blog                 # Name of website
    avatar: assets/img/triangular.svg     # Path of avatar image, to be displayed in the theme's header
    gravatar: f98....6bfc                 # MD5 hash of your email address
    description: My blog posts            # Short description, primarily used by search engines

Customizing text

Footer and Header's text

Customize your site header/footer with these variables in _config.yml:

  theme_settings:
    header_text: Welcome to my Jekyll blog
    header_text_feature_image: assets/img/sample3.png
    footer_text: Copyright 2017

Localisation string

Change localization string variables in _config.yml.

English text used in the theme has been grouped so you can quickly translate the theme or change labels to suit your needs.

  theme_settings:
     str_follow_on: "Follow on"
     str_rss_follow: "Follow RSS feed"
     str_email: "Email"
     str_next_post: "Next post"
     str_previous_post: "Previous post"
     str_next_page: "Next"
     str_previous_page: "Prev"
     str_continue_reading: "Continue reading"
     str_javascript_required_disqus: "Please enable JavaScript to view comments."

Other features

Jekyll works with liquid tags usually represented by:

{{ liquid.tag | filter }}

These are useful to render your jekyll files. You can learn more about them on shopify's doc

Footer's icons

Display the site's icon from Font Awesome in the footer. All icon variables should be your username enclosed in quotes (e.g. "username") in _config.yml, except for the following variables:

  theme_settings:
     rss: true
     email_address: [email protected]
     linkedin: ttps://www.linkedin.com/in/FirstLast
     stack_exchange: https://stackoverflow.com/users/0000/first-last

Comments (via Disqus)

Optionally, if you have a Disqus account, you can show a comments section below each post.

To enable Disqus comments, add your Disqus shortname to your project's _config.yml file:

  theme_settings:
     disqus_shortname: my_disqus_shortname

Google Analytics

To enable Google Analytics, add your tracking ID to _config.yml like so:

  theme_settings:
     google_analytics: UA-NNNNNNNN-N

Math typesetting

When KateX is set in _config.yml:

  theme_settings:
     katex: true # to Enable it

You can then wrap math expressions with $$ signs in your posts and make sure you have set the katex variable in _config.yml to true for math typesetting.

For inline math typesetting, type your math expression on the same line as your content. For example:

Type math within a sentence $$2x^2 + x + c$$ to display inline

For display math typesetting, type your math expression on a new line. For example:

$$
  \bar{y} = {1 \over n} \sum_{i = 1}^{n}y_i
$$

Layout

Please refer to the Jekyll docs for writing posts. Non-standard features are documented below.

Layout: Post

This are the basic features you can use with the post layout.

---
layout: post
title: Hello World                                # Title of the page
subtitle: "This is a subtitle"                    # A subtitle can be displayed below your title
feature-img: "assets/img/sample.png"              # Add a feature-image to the post
thumbnail: "assets/img/thumbnail/sample-th.png"   # Add a thumbnail image on blog view
tags: [sample, markdown, html]
---

With thumbnail, you can add a smaller image than the feature-img. If you don't want/have a thumbnail you can still use the same image as the feature one.

Layout: Page

The page layout have a bit more features explained here.

---
layout: page
title: "About" 
subtitle: "This is a subtitle"   
feature-img: "assets/img/sample.png" 
permalink: /about.html               # Set a permalink your your page
hide: true                           # Prevent the page title to appear in the navbar
tags: [sample, markdown, html]
---

The hide only hides your page from the navigation bar, it is however still generated and can be access through its link. Use the _draft folder to keep files from being generated on your site.

Layout: Bootstrap

This is the page layout modified to have bootstrap activated to format your content accordingly with the theme.

--- 
layout: bootstrap
---

Layout: Default

This layout includes the head, navigation bar and footer around your content.

Feature pages

All feature pages besides the "home" one are stored in the page folder, they will appear in the navigation bar unless you set Hide: true in the front matter.

Here are the documentation for the other feature pages that can be added through _config.yml.

Home

This page is the used as the home page of the template (in the index.html). It displays the list of article in _posts. You can use this layout in another page (adding a title to it will make it appear in the navigation bar).

Portfolio

Portfolio is a feature bootstrapped page that will take all the markdown/html files in the _portfolio folder to create a 3x3 image portfolio matrix.

The portfolio page can be enable/disable in the navigation bar through the _config.yml via:

# Scripts / Feature
  portfolio: true

Search

The search feature is based on Simple-Jekyll-search there is a search.json file that will create a list of all of the site posts, pages and portfolios.

Then there's a search.js displaying the formated results entered in the search.html page.

The search page can be enable/disable in the navigation bar through the _config.yml via:

# Scripts / Feature
  search: true

Tags

Tags should be placed between [] in your post metadata. Seperate each tag with a comma. Tags are recommended for posts and portfolio items.

For example:

---
layout: post
title: Markdown and HTML
tags: [sample, markdown, html]
---

Tags are case sensitive Tag_nAme โ‰  tag_name

All the tags will be listed in tags.html with a link toward the pages or posts. The tags page can be enable/disable in the navigation bar through the _config.yml via:

# Scripts / Feature
  tags: true

Template as a Gem

You can use Type-on-strap as a gem. Checkout an example in the gem-demo branch. To make the feature pages available in from the gem I created them as layouts that can be invoked in the pages folder.

So if you're using the template as a theme:

  • Make sure you have a index.html
  • The right _config.yml with the theme setting such as theme: type-on-strap uncommented
  • You have included the feature page (using layout or include as it is already in pages)
  • You have your content ready in _posts and _portfolio

License

The MIT License (MIT)

type-on-strap's People

Contributors

sylhare avatar misriadi0896 avatar fadillahalazmi2601 avatar arthurlacoste avatar peavers avatar imgbotapp avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.