Move search to _libraries

This commit is contained in:
Stéphane Goetz 2019-09-20 23:19:39 +02:00
parent b06009ebbd
commit 57b3848430
10 changed files with 7 additions and 12 deletions

View File

@ -23,7 +23,6 @@ COPY libs/ /daux/libs/
COPY templates/ /daux/templates/
COPY themes/ /daux/themes/
COPY _libraries/ /daux/_libraries/
COPY search/ /daux/search/
COPY global.json /daux/global.json
COPY index.php /daux/index.php

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -25,7 +25,7 @@ module.exports = {
search: {
runner: "rollup",
source: "src/js/search/index.js",
destination: "search/search.min.js"
destination: "_libraries/search.min.js"
},
theme_daux: {
runner: "rollup",

View File

@ -78,12 +78,8 @@ class Generator implements \Todaymade\Daux\Format\Base\Generator, LiveGenerator
);
if ($params['html']['search']) {
GeneratorHelper::copyRecursive(
$this->daux->local_base . DIRECTORY_SEPARATOR . 'search' . DIRECTORY_SEPARATOR,
$destination . DIRECTORY_SEPARATOR . 'search'
);
file_put_contents(
$destination . DIRECTORY_SEPARATOR . 'search' . DIRECTORY_SEPARATOR . 'search_index.json',
$destination . DIRECTORY_SEPARATOR . '_search_index.json',
json_encode(['pages' => $this->indexed_pages])
);

File diff suppressed because one or more lines are too long

View File

@ -30,7 +30,7 @@ class SearchEngine {
descriptiveWords: 25,
highlightTerms: true,
highlightEveryTerm: false,
contentLocation: "search/search_index.json",
contentLocation: "_search_index.json",
...options
};

View File

@ -44,7 +44,7 @@
<?php if ($params['html']['search']) { ?>
<!-- Search -->
<link href="<?= $base_url; ?>search/search.css" rel="stylesheet">
<link href="<?= $base_url; ?>_libraries/search.css" rel="stylesheet">
<?php } ?>
</head>
<body class="<?= $params['html']['float'] ? 'with-float' : ''; ?> <?= $this->section('classes'); ?>">

View File

@ -23,7 +23,7 @@
</script>
<!-- Search -->
<script type="text/javascript" src="<?php echo $base_url; ?>search/search.min.js"></script>
<script type="text/javascript" src="<?php echo $base_url; ?>_libraries/search.min.js"></script>
<script>
window.search({'base_url': '<?php echo $base_url?>'})