work in progress

master
Stefen Wakefield 7 months ago
parent 1dfdf4d6e3
commit 284be8ed6a
Signed by: xstefen
GPG Key ID: F52B5BFA7BD26BB4
  1. 1
      Gemfile
  2. 7
      Gemfile.lock
  3. 0
      LICENSE
  4. 12
      _config.yml
  5. 9
      _includes/head.html
  6. 0
      _pages/404.md
  7. 0
      _pages/about.md
  8. 52
      _plugins/jekyll-pages-directory.rb
  9. 1
      index.md

@ -5,6 +5,7 @@ gem "jekyll", "~> 4.2.0"
group :jekyll_plugins do
gem "jekyll-feed"
gem "jekyll-seo-tag"
gem "jekyll-target-blank"
end
gem "tzinfo-data"

@ -35,6 +35,9 @@ GEM
sassc (> 2.0.1, < 3.0)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-target-blank (2.0.0)
jekyll (>= 3.0, < 5.0)
nokogiri (~> 1.10)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.4.0)
@ -46,9 +49,12 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
nokogiri (1.13.6-x64-mingw-ucrt)
racc (~> 1.4)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.7)
racc (1.6.0)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
@ -74,6 +80,7 @@ DEPENDENCIES
jekyll (~> 4.2.0)
jekyll-feed
jekyll-seo-tag
jekyll-target-blank
tzinfo
tzinfo-data
wdm

@ -7,6 +7,9 @@ timezone: "US/Central"
description: >
Yet another xstefen attempt at starting a blog or project or something.
# /assets/favicon.ico
favicon_in_assets: true
# atom/rss
head_link_rss_feed: true
feed:
@ -26,9 +29,16 @@ footer: "this is a footer"
markdown: "kramdown"
permalink: /:year/:month/:day/:slug
plugins:
- jekyll-feed
- jekyll-seo-tag
- jekyll-target-blank
sass:
style: compressed
style: compressed
exclude:
- LICENSE
- README.md

@ -9,9 +9,14 @@
<meta name="robots" content="{{page.robots}}" />
{% endif %}
{%- if site.head_link_rss_feed -%}
{% if site.favicon_in_assets %}
<link rel="shortcut icon" type="image/x-icon" href="{{ "/assets/favicon.ico" | relative_url }}">
<link rel="icon" type="image/x-icon" href="{{ "/assets/favicon.ico" | relative_url }}">
{% endif %}
{% if site.head_link_rss_feed %}
<link rel="alternate" type="application/rss+xml" href="{{ site.url }}/rss.xml">
{%- endif -%}
{% endif %}
{%- if site.listen_for_clients_preferred_style -%}
<link rel="stylesheet" type="text/css" href="{{ "/assets/main.css" | relative_url }}">

@ -0,0 +1,52 @@
module Jekyll
class PagesDirGenerator < Generator
def generate(site)
pages_dir = site.config['pages'] || './_pages'
all_raw_paths = Dir["#{site.source}/#{pages_dir}/**/*"]
all_raw_paths.each do |f|
if File.file?(f)
filename = f.match(/[^\/]*$/)[0]
clean_filepath = f.gsub(/^#{site.source}\/#{pages_dir}\//, '')
clean_dir = extract_directory(clean_filepath)
site.pages << PagesDirPage.new(site,
site.source,
clean_dir,
filename,
pages_dir)
end
end
end
def extract_directory(filepath)
dir_match = filepath.match(/(.*\/)[^\/]*$/)
if dir_match
return dir_match[1]
else
return ''
end
end
end
class PagesDirPage < Page
def initialize(site, base, dir, name, pagesdir)
@site = site
@base = base
@dir = dir
@name = name
process(name)
read_yaml(File.join(base, pagesdir, dir), name)
data.default_proc = proc do |hash, key|
site.frontmatter_defaults.find(File.join(dir, name), type, key)
end
Jekyll::Hooks.trigger :pages, :post_init, self
end
end
end

@ -2,6 +2,7 @@
title: /
layout: home
permalink: /
lastmod: 2022-05-19T13:44:26.857Z
---
# Lorem ipsum

Loading…
Cancel
Save