Skip to content

Commit

Permalink
added admin and jekyll-seo
Browse files Browse the repository at this point in the history
  • Loading branch information
bamr87 committed Dec 4, 2023
1 parent 7deee04 commit 02cc376
Show file tree
Hide file tree
Showing 8 changed files with 272 additions and 14 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ group :jekyll_plugins do
gem 'jekyll-algolia'
gem 'jekyll-assets', "~> 1.0.0"
gem 'jekyll-mermaid'
gem 'jekyll-admin'
# gem 'jekyll-spaceship'

# these are all part of the github-pages gem
Expand Down
12 changes: 12 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ maintainers:
- name: "Vacant"
profile: "/github.com"


## Admin Information----------------------------------------------------------

jekyll_admin:
# hidden_links:
# - posts
# - pages
# - staticfiles
# - datafiles
# - configuration
homepage: "pages"

## Personalization ----------------------------------------------------------------

locale : "en-US"
Expand Down
Binary file added assets/images/jekyll-seo-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/jekyll-seo-snippet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions frontmatter.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@
"title": "lastmod",
"name": "lastmod",
"type": "datetime"
},
{
"title": "key",
"name": "key",
"type": "string"
},
{
"title": "index",
"name": "index",
"type": "number"
},
{
"title": "subcategory",
"name": "subcategory",
"type": "string"
}
]
},
Expand Down
28 changes: 14 additions & 14 deletions index.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
---
title: Hello World
sub-title: Welcome to my landing site of this world
description: "This is the index.md file for the whole site and root "
preview: /images/nubi-yawn.png
excerpt: ""
description: This is the index.md file for the whole site and root
preview: "/images/nubi-yawn.png"
layout: root
keywords:
- Root
- Algolia
- Bootstrap
- Github
- GitHub Pages
- Jekyll
- TravisCI
- Web Development
- Root
- Algolia
- Bootstrap
- Github
- GitHub Pages
- Jekyll
- TravisCI
- Web Development
tags:
- index
- index
categories:
- hello world
lastmod: 2022-08-28T01:51:53.807Z
- hello world
lastmod: '2022-08-28 01:51:53 +0000'
---

Hello world, and welcome to my site. Click on `Home` in the navigation bar to get started.
Expand All @@ -38,6 +37,7 @@ Nothing to see here. Yet... but try clicking on the gear icon (or particles) for
## Features
{: .collapse .collapsed .dev-settings }
- [x] Github Pages compatibility
- [x] Jekyll Admin
- [x] MathJax
- [x] Bootstrap 5 CDN
- [x] Algolia Search indexing
Expand Down
197 changes: 197 additions & 0 deletions pages/_docs/jekyll-seo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
---
key: tutorial
title: Jekyll - SEO
index: 8131
subcategory: jekyll
date: 2023-12-04T19:48:04.694Z
tags:
- SEO
- CDN
- DNS
lastmod: 2023-12-04T22:41:17.301Z
slug: jekyll-seo
description: This is a tutorial about how to optimize the website to improve the rankings.
draft: true
categories:
- jekyll
preview: /images/jekyll-seo-preview.png
sub-title: SEO Optimization using Jekyll
author: Amr
excerpt: Search engine optimization (`SEO`) is the process of increasing the quality and quantity of website traffic by increasing the visibility of a website or a web page to users of a web search engine.
snippet: /images/jekyll-seo-snippet.png
---

[Google Search Docs](https://developers.google.com/search)

SEO (Search Engine Optimization) optimization is a crucial aspect for any website, and this is no different for sites built with Jekyll, the popular static site generator. By nature, Jekyll offers a lean and fast-loading website structure, which is a positive factor for SEO. However, there are specific strategies you can employ to further enhance your Jekyll site's SEO.

1. **Optimizing Content**: The cornerstone of SEO is high-quality, relevant content. With Jekyll, you can easily manage content through Markdown files, ensuring that your text is clear, well-structured, and includes appropriate keywords.

2. **URL Structure**: Jekyll allows for customization of URL structures. By using meaningful and keyword-rich URLs, you can make your pages more understandable to search engines and users.

3. **Meta Tags**: Incorporate meta tags for titles and descriptions in your Jekyll site's HTML templates. These tags help search engines understand the content of your pages and display them appropriately in search results.

4. **Mobile Responsiveness**: Jekyll supports responsive design themes, which is vital since mobile-friendliness is a significant ranking factor for search engines.

5. **Loading Speed**: Jekyll generates static sites, which generally load faster than dynamic websites. You can further optimize this by minimizing CSS, JavaScript, and image sizes.

6. **Sitemaps and Robots.txt**: Use Jekyll plugins to generate sitemaps automatically and manage robots.txt files, ensuring search engines can efficiently crawl and index your site.

7. **Social Media Integration**: Integrating social media sharing options can increase the visibility of your content, indirectly boosting your SEO efforts.

8. **Analytics**: Incorporate tools like Google Analytics to track your site’s performance, understand your audience better, and fine-tune your SEO strategies.

9. **Regular Updates**: Regularly updating your website with fresh content can signal to search engines that your site is active and relevant.

By implementing these strategies, you can significantly improve your Jekyll site's SEO, making it more visible and accessible to your target audience.

## 1. SEO

### 1.1 robots.txt

Use Jekyll plugins to generate sitemaps automatically and manage robots.txt files, ensuring search engines can efficiently crawl and index your site.

I.e., Prevent web crawlers from specific content.


```sh
# e.g. /note.

User-agent: *
Disallow: /note/
Sitemap: http://{{ site.github_user }}.github.io/sitemap.xml

User-agent: *
Disallow: /private/
Disallow: /tmp/
Disallow: /duplicate-content/
Disallow: /under-development/
Allow: /public-content/
Disallow: /*.gif$
Disallow: /*.xls$

# Sitemap location
Sitemap: https://www.yoursite.com/sitemap.xml

# Specific rules for certain bots
User-agent: Googlebot
Disallow: /no-google/

User-agent: Bingbot
Disallow: /no-bing/

# Delay between successive requests (in seconds)
Crawl-delay: 10


```

### 1.2 RSS Feed

Edit /blog/atom.xml

```html

{%- raw -%}
---
layout: nil
type: blog
---

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

<title>{{ site.blogtitle }}</title>
<link href="{{ site.url }}/blog/atom.xml" rel="self"/>
<link href="{{ site.url }}/blog"/>
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ site.url }}</id>
<author>
<name>{{ site.author.name }}</name>
<email>{{ site.author.email }}</email>
</author>

{% for post in site.posts %}
<entry>
<title>{{ post.title }}</title>
<link href="{{ site.url }}{{ post.url }}"/>
<updated>{{ post.date | date_to_xmlschema }}</updated>
<id>{{ site.url }}{{ post.id }}</id>
<content type="html">{{ post.content | xml_escape }}</content>
</entry>
{% endfor %}

</feed>
{% endraw %}
```

![image](/assets/images/jekyll/8131/rssfeed.png)
### 1.3 Sitemap

```xml
{%- raw -%}
---
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for page in site.pages %}
{% if page.layout != nil and page.layout != 'feed' and page.url != '/note/' and page.url != '/index_note/' and page.url != '/index_tutorial/' and page.url != '/search/' and page.url != '/blog/atom.xml' and page.url != '/contact/'%}
<url>
<loc>http://{{ site.github_user }}.github.io{{ page.url | remove: 'index.html' }}</loc>
</url>
{% endif %}
{% endfor %}

{% assign portfolios = site.portfolio %}
{% assign blogs = site.posts %}
{% assign posts = portfolios | concat: blogs %}
{% for post in posts %}
<url>
<loc>http://{{ site.github_user }}.github.io{{ post.url | remove: 'index.html' }}</loc>
</url>
{% endfor %}

</urlset>
{% endraw %}
```

![image](/assets/images/jekyll/8131/sitemap.png)

## 2. Caching with CDN

### 2.1 Create a new account in Cloudflare

Add a new site, note the two name servers

* miki.ns.cloudflare.com
* owen.ns.cloudflare.com

### 2.2 Update Name server in GoDaddy

Find your domain, click the three dot button, choose 'Manage DNS'.
![image](/assets/images/jekyll/8131/godaddy_mydomains.png)
Scroll down, see the Nameservers section, click 'Change' btton.
![image](/assets/images/jekyll/8131/godaddy_nameservers.png)
Select 'Custom' type and input two Cloudflare name servers.
![image](/assets/images/jekyll/8131/godaddy_changenameserver.png)
Done.
![image](/assets/images/jekyll/8131/godaddy_done.png)
You will receive an email from CloudFlare.
![image](/assets/images/jekyll/8131/cloudflare_notification.png)

## 3. Move Javascript Files to Bottom

Put javascript files to the bottom of the page can speed up the loading.

## 4. Reference

* [About robots.txt](https://www.robotstxt.org/robotstxt.html)
* [How to Use XML Sitemaps to Boost SEO](https://www.searchenginejournal.com/xml-sitemaps-seo/)
* [JEKYLL - GENERATING A SITEMAP.XML WITHOUT A PLUGIN](http://www.independent-software.com/generating-a-sitemap-xml-with-jekyll-without-a-plugin.html)
* [10 Must do Jekyll SEO optimizations](https://blog.webjeda.com/optimize-jekyll-seo/)
* [Free Secure Web: Jekyll & Github Pages & Cloudflare](https://martin.ankerl.com/2017/07/22/free-secure-web-jekyll-github-pages-cloudflare/)
* [How to Change Nameservers in GoDaddy?](https://www.webnots.com/how-to-change-nameservers-in-godaddy/)
* [How to Deploy Websites on Custom Domains using Cloudflare and Github Pages](https://medium.com/crowdbotics/annie-azana-how-to-deploy-websites-using-cloudflare-and-github-pages-c415c55fea36)
* [Fix Defer Parsing of Javascript Warning in WordPress Using Async](https://www.collectiveray.com/defer-parsing-of-javascript-wordpress-async)
* [Demo - Put Scripts at the Bottom](http://stevesouders.com/examples/rule-js-bottom.php)
* [Search engine optimization for GitHub Pages](https://help.github.com/en/articles/search-engine-optimization-for-github-pages)
33 changes: 33 additions & 0 deletions pages/_posts/2023-12-04-robots-dot-txt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: robots dot txt
sub-title: ""
author: ""
excerpt: ""
description: ""
snippet: 2023-12-04T21:15:31.625Z
categories: []
tags: []
draft: 2023-12-04T21:15:31.625Z
lastmod: 2023-12-04T22:40:40.615Z
type: Article
---


A `robots.txt` file is used to instruct web robots (typically search engine robots) which pages on your website to crawl and which not to. Here's an example of a `robots.txt` file that you might use for a Jekyll site:

```plaintext
User-agent: *
Disallow: /secret/
Disallow: /private/
Disallow: /tmp/
Sitemap: https://www.yoursite.com/sitemap.xml
```

In this example:

- `User-agent: *` means that the instructions apply to all web robots.
- `Disallow: /secret/` tells robots not to crawl pages under the `/secret/` directory.
- `Disallow: /private/` and `Disallow: /tmp/` do the same for these directories.
- `Sitemap: https://www.yoursite.com/sitemap.xml` provides the location of your site's sitemap, which is helpful for search engines to find and index your content.

Remember to replace `https://www.yoursite.com/sitemap.xml` with the actual URL of your sitemap. Also, the `Disallow` entries should be adjusted based on the specific directories or pages you want to keep private or don't want to be indexed by search engines.

0 comments on commit 02cc376

Please sign in to comment.