Skip to content

Commit

Permalink
Deploy testing
Browse files Browse the repository at this point in the history
  • Loading branch information
rsnyder committed Oct 4, 2023
1 parent 1eae27e commit ca33921
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.ve-meta title="Plant Humanities"

# Featured Plant Narratives {.cards}
# Featured Plant Narratives
<param class="cards">

##
[**Maize: Sacred Plant, Global Commodity**](/maize)
Expand Down Expand Up @@ -58,7 +59,8 @@

![](/images/thumbnails/Cryptomeria.jpeg)

# All Plant Narratives {.cards}
# All Plant Narratives
<param class="cards">

##
[**Agave: A Plant with an Intoxicating History**](/Agave)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion contributors/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<param ve-config title="Plant Humanities Lab">

# Essay Contributors {.cards}
# Essay Contributors
<param class="cards">

##
**Thomas C. Anderson**
Expand Down
2 changes: 1 addition & 1 deletion juncture/components/JunctureV1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ module.exports = {
})
this.entities = await this.getEntityData(this.findEntities(tmp, this.params))
this.html = tmp.outerHTML
let essayConfig = this.params.find(param => param['ve-config'])
let essayConfig = this.params.find(param => param['ve-config']) || {}
essayConfig.header = essayConfig.header || 'header'
essayConfig.main = essayConfig.main || essayConfig.component || 'visual-essay'
essayConfig.footer = essayConfig.footer || 'footer'
Expand Down
60 changes: 60 additions & 0 deletions restructure-for-ghp-hosting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

'''
Restructures the site to be more like a Jekyll site.
'''

import logging
logging.basicConfig(format='%(asctime)s : %(filename)s : %(levelname)s : %(message)s')
logger = logging.getLogger()
logger.setLevel(logging.INFO)

import argparse, os, re
from pathlib import Path

BASEDIR = os.path.abspath(os.path.dirname(__file__))

done = False

def reformat_cards(path):
global done
md = open(path, 'r').read()
if re.search(r'{\s*\.cards\s*}', md):
md = re.sub(r'{\s*\s*\.cards\s*}', '\n<param class="cards">', md)
md = re.sub(r'(?P<tag>#+)\s(?P<title>.*)\s+{\s*href=(?P<href>[^}\s]+)\s*}', r'\1 \2\n\n[\2](\3)', md)
logger.info(path)
with open(path, 'w') as f:
f.write(md)
# done = True

def main(root=BASEDIR, **kwargs):
global done
logger.info(f'Root: {root}')
for root, dirs, files in os.walk(root):
for filename in files:
if '/.venv/' in root: continue
if filename == 'README.md':
reformat_cards(os.path.join(root, filename))
if done: break
elif filename.endswith('.md'):
# print(os.path.join(root, filename))
print(f'mkdir: {os.path.join(root, filename[:-3])}')
os.mkdir(os.path.join(root, filename[:-3]))
src = Path(os.path.join(root, filename))
dest = Path(os.path.join(root, filename[:-3], 'README.md'))
print(f'move: {src} to {dest}')
src.rename(dest)
if done: break

if __name__ == '__main__':
logger.setLevel(logging.INFO)
parser = argparse.ArgumentParser()
parser.add_argument('--root', type=str, help='Root directory')
args = vars(parser.parse_args())
if args['root'] is None:
args['root'] = BASEDIR
elif not os.path.isabs(args['root']):
args['root'] = os.path.abspath(os.path.join(BASEDIR, args['root']))

main(**args)

0 comments on commit ca33921

Please sign in to comment.