Skip to content

Commit

Permalink
Migrate to Jekyll (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradh352 authored Jul 4, 2024
1 parent 59d188a commit e058934
Show file tree
Hide file tree
Showing 111 changed files with 801 additions and 1,596 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Deploy Pages
name: Deploy Jekyll with GitHub Pages

on:
# Runs on pushes targeting the default branch
push:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -25,46 +23,34 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: |
sudo apt-get install -y markdown make
- name: Checkout
uses: actions/checkout@v4
- name: Checkout c-ares docs
uses: actions/checkout@v4
with:
repository: c-ares/c-ares
path: c-ares.git
- name: Checkout roffit
uses: actions/checkout@v4
with:
repository: "bagder/roffit"
path: roffit
path: roffit.git
- name: Build and Install roffit
run: |
cd roffit
cd roffit.git
sudo make install
- name: Checkout fcpp
uses: actions/checkout@v4
with:
repository: "bagder/fcpp"
path: fcpp
- name: Build and Install fcpp
run: |
cd fcpp
sudo make install
- name: Checkout source needed to build docs
uses: actions/checkout@v4
with:
repository: "c-ares/c-ares"
path: ares-cvs
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build pages
- name: Build external pages
run: |
make
- name: Clean up files we don't want deployed
run: |
rm -rf ares-cvs fcpp roffit .deps *.gen *.raw *.t *.md Makefile download/Makefile download/*.t
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./

# Deployment job
deploy:
Expand All @@ -73,6 +59,7 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
if: github.repository == 'c-ares/c-ares.github.io' && github.refs == 'refs/heads/main'
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down
13 changes: 9 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
*.html
*.raw
*.gen
ares-cvs
Gemfile.lock
_site
.sass-cache
.deps
c-ares.git
roffit.git
docs
security.md
license.md

1 change: 0 additions & 1 deletion .htaccess

This file was deleted.

24 changes: 24 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
layout: default
---

<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>

<div class="container">
<h1>404</h1>

<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>
43 changes: 43 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
source "https://rubygems.org"

# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
#gem "jekyll", "~> 3.9.5"

# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.0"

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
gem "github-pages", "~> 231",group: :jekyll_plugins

# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.6"
end

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", ">= 1", "< 3"
gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0", :install_if => Gem.win_platform?

# kramdown v2 ships without the gfm parser by default. If you're using
# kramdown v1, comment out this line.
gem "kramdown-parser-gfm"

# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]

gem "webrick"
131 changes: 27 additions & 104 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,127 +1,50 @@
.DEFAULT_GOAL := all
ROOT=.
DEPDIR=.deps

MAINPARTS= $(ROOT)/doctype.t body.t footer.t $(ROOT)/setup.t \
menu.t Makefile docmenu.t css.t
OPTS=-WWW -Uunix -H -C -V -I$(ROOT) -LL
FCPP=fcpp
ACTION=$(FCPP) $(OPTS) $< $@
SRCDIR=ares-cvs
SRCDIR=c-ares.git
DOCSDIR=$(SRCDIR)/docs
MAN2HTML= roffit --bare --mandir=$(DOCSDIR) --hrefdir=.
MARKDOWN=markdown
DOCSDEST=docs
MAN2HTML=roffit --bare --mandir=$(DOCSDIR) --hrefdir=/$(DOCSDEST)
MANPAGES_SRC=$(sort $(shell find $(DOCSDIR) -name "*.3"))
MANPAGES=$(sort $(notdir $(MANPAGES_SRC:.3=.html)))
DEPFILES=$(MANPAGES:%.html=$(DEPDIR)/%.d)
MANPAGES=$(addprefix $(DOCSDEST)/,$(sort $(notdir $(MANPAGES_SRC:.3=.html))))
MANPAGES_NAMES=$(sort $(notdir $(MANPAGES_SRC)))
DEPFILES=$(MANPAGES_NAMES:%.3=$(DEPDIR)/%.d)

PAGES=$(MANPAGES) security.md license.md

PAGES = \
adv_20160929.html \
adv_20170620.html \
adv_20210810.html \
changelog.html \
docs.html \
index.html \
indexbot.html \
indextop.html \
license.html \
mailbot.html \
mailhead.html \
mailtop.html \
old.html \
otherlibs.html \
security.html \
vulns.html \
why.html \
$(MANPAGES)
$(DOCSDEST):
mkdir -p $@

$(DEPDIR):
$(DEPDIR): $(DOCSDEST)
mkdir -p $@

$(DEPDIR)/%.d: $(DOCSDIR)/%.3
sed -n -e 's|^\.so man[0-9]/\(.*\.[0-9]\).*|$*.html: $(DOCSDIR)/\1|p' < $< > $@
sed -n -e 's|^\.so man[0-9]/\(.*\.[0-9]\).*|/$(DOCSDEST)/$*.html: $(DOCSDIR)/\1|p' < $< > $@

%.html: $(DOCSDIR)/%.3 $(DEPDIR)/%.d
$(MAN2HTML) < $< >$*.raw
$(FCPP) $(OPTS) -Dfunc=$* -Ddocs_$* -Dfuncinc=\"$*.raw\" ares_func.t $@
$(DOCSDEST)/%.html: $(DOCSDIR)/%.3 $(DEPDIR)/%.d
$(MAN2HTML) < $< > $(DOCSDEST)/$*.raw
echo "---\nlayout: page\n---" > $(DOCSDEST)/$*.html
cat $(DOCSDEST)/$*.raw >> $(DOCSDEST)/$*.html
rm -f $(DOCSDEST)/$*.raw

security.md: c-ares.git/SECURITY.md
echo "---\nlayout: page\ntitle: \"\"\n---" > $@
cat $< >> $@

license.md: c-ares.git/LICENSE.md
echo "---\nlayout: page\ntitle: \"\"\nmenu: License\npermalink: /license/\n---" > $@
cat $< >> $@

$(DEPFILES): $(DEPDIR)

include $(DEPFILES)

all: $(PAGES)
make -C download

.PHONY: all

index.html: index.t $(MAINPARTS)
$(ACTION)

changelog.html: changelog.t $(MAINPARTS) changelog.gen
$(ACTION)

changelog.gen: changelog.md
$(MARKDOWN) < $< > $@

vulns.html: vulns.t $(MAINPARTS)
$(ACTION)

security.html: security.t $(MAINPARTS) security.gen
$(ACTION)

security.gen: $(SRCDIR)/SECURITY.md
$(MARKDOWN) < $< > $@

license.gen: $(SRCDIR)/LICENSE.md
$(MARKDOWN) < $< > $@

adv_20160929.html: adv_20160929.t $(MAINPARTS) adv_20160929.gen
$(ACTION)
adv_20160929.gen: adv_20160929.md
$(MARKDOWN) < $< > $@

adv_20170620.html: adv_20170620.t $(MAINPARTS) adv_20170620.gen
$(ACTION)
adv_20170620.gen: adv_20170620.md
$(MARKDOWN) < $< > $@

adv_20210810.html: adv_20210810.t $(MAINPARTS) adv_20210810.gen
$(ACTION)
adv_20210810.gen: adv_20210810.md
$(MARKDOWN) < $< > $@

old.html: old.t $(MAINPARTS)
$(ACTION)

otherlibs.html: otherlibs.t $(MAINPARTS)
$(ACTION)

why.html: why.t $(MAINPARTS)
$(ACTION)

docs.gen: $(MANPAGES)
@echo "$(MANPAGES)" | sed 's/\([a-zA-Z0-9_]*\)\.html/<li><a href="\1.html">\1<\/a>\n/g' > $@

docs.html: docs.t docs.gen $(MAINPARTS)
$(ACTION)

license.html: license.t $(MAINPARTS) license.gen
$(ACTION)

mailhead.html: mailhead.t $(MAINPARTS)
$(ACTION)

mailtop.html: mailtop.t $(MAINPARTS) mailmenu.t
$(ACTION)
mailbot.html: mailbot.t $(MAINPARTS)
$(ACTION)
indextop.html: indextop.t $(MAINPARTS) mailmenu.t
$(ACTION)
indexbot.html: indexbot.t $(MAINPARTS)
$(ACTION)

clean:
find . -name "*~" -exec rm {} \;
rm -f *.raw *.html *.gen
rm -rf $(PAGES) $(DOCSDEST)/*.raw
rm -rf $(DEPDIR)
make -C download clean

18 changes: 0 additions & 18 deletions README.md

This file was deleted.

44 changes: 44 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Welcome to Jekyll!
#
# This config file is meant for settings that affect your whole blog, values
# which you are expected to set up once and rarely edit after that. If you find
# yourself editing this file very often, consider using Jekyll's data files
# feature for the data you need to update frequently.
#
# For technical reasons, this file is *NOT* reloaded automatically when you use
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.

# Site settings
# These are used to personalize your new site. If you look in the HTML files,
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.
title: "c-ares: a modern asynchronous DNS resolver"
description: >-
c-ares is a modern DNS (stub) resolver library, written in C. It provides
interfaces for asynchronous queries while trying to abstract the intricacies
of the underlying DNS protocol. It was originally intended for applications
which need to perform DNS queries without blocking, or need to perform multiple
DNS queries in parallel.
domain: c-ares.org
baseurl: "" # the subpath of your site, e.g. /blog
url: "https://c-ares.org"
github_username: c-ares

# Build settings
markdown: GFM
theme: minima
plugins:
# - jekyll-feed

# Exclude from processing.
# The following items will not be processed, by default. Create a custom list
# to override the default setting.
exclude:
- Gemfile
- Gemfile.lock
- c-ares.git
- roffit.git
- Makefile
- docs/*.raw
- .deps
10 changes: 10 additions & 0 deletions _includes/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<footer class="site-footer h-card">
<data class="u-url" href="{{ "/" | relative_url }}"></data>
<div class="wrapper">
<div style="text-align: center;">
{%- include social.html -%}
&copy; 2024 the c-ares project and its contributors
</div>
</div>

</footer>
Loading

0 comments on commit e058934

Please sign in to comment.