Skip to content

Commit 1cc2a92

Browse files
committed
Convert .hidden to a File
1 parent 24f8796 commit 1cc2a92

4 files changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/Docs4NIST.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ jobs:
1212
formats: |-
1313
epub
1414
pdf
15+
hidden: true

ntd2d/ntd2d_action/files/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from .borgedconffile import BorgedConfFile
66
from .conffile import ConfFile
77
from .cssfile import CSSFile
8+
from .hiddenfile import HiddenFile
89
from .indexfile import IndexFile
910
from .menufile import MenuFile
1011
from .nojekyllfile import NoJekyllFile
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from .file import File
2+
3+
4+
class HiddenFile(File):
5+
# Add a file that indicates docs should not be included in variant menu
6+
7+
def __init__(self, html_dir):
8+
self.html_dir = html_dir
9+
10+
@property
11+
def path(self):
12+
return self.html_dir / ".hidden"

ntd2d/ntd2d_action/repository.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import github_action_utils as gha_utils
77
import pathlib
88

9-
from .files import NoJekyllFile
9+
from .files import NoJekyllFile, HiddenFile
1010
from .variants import Variant, VariantCollector
1111

1212
class Repository:
@@ -102,7 +102,7 @@ def update_pages(self, branch, sha, hidden=False):
102102
gha_utils.debug(f"Variant {variant.name}", use_subprocess=True)
103103

104104
if hidden:
105-
(self.docs.html_dir / ".hidden").touch()
105+
HiddenFile(html_dir=self.docs.html_dir).write()
106106

107107
variant.copy_html(src=self.docs.html_dir)
108108
variant.copy_download_file(src=self.docs.epub_file, kind="ePUB")

0 commit comments

Comments
 (0)