Skip to content

Commit d6341de

Browse files
committed
Generate ACVP site without raw HTML/CSS
1 parent 3303083 commit d6341de

File tree

7 files changed

+314
-712
lines changed

7 files changed

+314
-712
lines changed

.github/workflows/docker-build.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,19 @@ jobs:
1515
password: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
1616
steps:
1717
- uses: actions/checkout@v2
18-
with:
19-
token: ${{ secrets.METANORMA_CI_PAT_TOKEN || github.token }}
20-
submodules: true
2118

2219
- uses: actions/cache@v2
2320
with:
2421
path: /config/fonts
2522
key: metanorma-nist-fonts
2623
restore-keys: metanorma-nist-fonts
2724

25+
- name: Cache built documents
26+
uses: actions/cache@v2
27+
with:
28+
path: site/
29+
key: ${{ hashFiles('metanorma.yml') }}-${{ hashFiles('src/*.adoc') }}
30+
2831
- uses: metanorma/metanorma-build-scripts/gh-rubygems-setup-action@main
2932
with:
3033
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
@@ -35,6 +38,16 @@ jobs:
3538
with:
3639
agree-to-terms: true
3740

41+
- name: Build NIST site on GitHub Pages
42+
run: |
43+
rm -f site/index.html
44+
find site/documents/src \( -name '*.html' -or -name '*.pdf' -or \
45+
-name '*.rxl' -or -name '*.xml' \) -exec mv \{} site/ \;
46+
rm -rf site/documents
47+
cp _config.yml site/
48+
cp -a _includes site/
49+
cp README.md site/index.md
50+
3851
- uses: actions/upload-artifact@v2
3952
with:
4053
name: site
@@ -53,7 +66,7 @@ jobs:
5366

5467
- uses: peaceiris/actions-gh-pages@v3
5568
with:
56-
deploy_key: ${{ secrets.GH_DEPLOY_KEY }}
69+
github_token: ${{ github.token }}
5770
publish_dir: ./site
5871
publish_branch: nist-pages
5972
force_orphan: true

.gitignore

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
*.DS_Store
2-
*.html
3-
!index.html
4-
*.txt
5-
*.xml
6-
*.nits
1+
.DS_Store
2+
.sass-cache
73
*.err
84
*.log
95
Gemfile.lock

README.md

Lines changed: 231 additions & 231 deletions
Large diffs are not rendered by default.

_config.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,33 @@
11
theme: jekyll-theme-slate
2+
title: ACVP
3+
description: Industry Working Group on Automated Cryptographic Algorithm Validation
4+
5+
# TODO: Uncomment this block after merging into usnistgov/ACVP
6+
# url: https://pages.nist.gov
7+
# baseurl: "/ACVP" # the subpath of your site, e.g. "/blog"
8+
# repository: "usnistgov/ACVP"
9+
10+
# This disables the "View on GitHub" button on the Slate theme
11+
github:
12+
is_project_page: false
13+
14+
# Reading Files
15+
# include:
16+
exclude:
17+
- slides
18+
- iev
19+
- relaton
20+
- Images
21+
- src
22+
- metanorma.yml
23+
24+
plugins:
25+
- jekyll-coffeescript
26+
- jekyll-default-layout
27+
- jekyll-gist
28+
- jekyll-github-metadata
29+
- jekyll-optional-front-matter
30+
- jekyll-paginate
31+
- jekyll-readme-index
32+
- jekyll-titles-from-headings
33+
- jekyll-relative-links

_includes/head-custom.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!-- start custom head snippets, customize with your own _includes/head-custom.html file -->
2+
<script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script>
3+
<link rel="stylesheet" href="https://pages.nist.gov/nist-header-footer/css/nist-combined.css">
4+
<script src="https://pages.nist.gov/nist-header-footer/js/nist-header-footer.js" type="text/javascript" defer="defer"></script>
5+
<script src="https://pages.nist.gov/leaveNotice/js/jquery.leaveNotice-nist.min.js" type="text/javascript"></script>
6+
7+
<script async type="text/javascript" id="_fed_an_ua_tag" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=NIST&subagency=github&pua=UA-66610693-1&yt=true&exts=ppsx,pps,f90,sch,rtf,wrl,txz,m1v,xlsm,msi,xsd,f,tif,eps,mpg,xml,pl,xlt,c"></script>
8+
9+
<script type="text/javascript">
10+
$(document).ready(function(){
11+
// Mark external (non-nist.gov) 'a' tags with class "external"
12+
// If the address start with https and ends with nist.gov
13+
var re_nist = new RegExp('^https?:\/\/((^\/)*\.)*nist\\.gov(\/|$)');
14+
// Regex to find address that start with https
15+
var re_absolute_address = new RegExp('^((https?:)?\/\/)');
16+
$("a").each(function(){
17+
var url=$(this).attr('href');
18+
if(re_nist.test(url) || !re_absolute_address.test(url)){
19+
$(this).addClass('local');
20+
}else{
21+
$(this).addClass('external');
22+
}
23+
});
24+
25+
// Add leaveNotice to external 'a' elements
26+
$('a.external').leaveNotice({
27+
siteName: 'ACVP Specification',
28+
});
29+
});
30+
</script>
31+
<link rel="stylesheet" type="text/css" href="https://pages.nist.gov/leaveNotice/css/jquery.leaveNotice.css" />
32+
<!-- end custom head snippets -->

0 commit comments

Comments
 (0)