Skip to content

Commit

Permalink
Remove Algolia Admin (#145)
Browse files Browse the repository at this point in the history
* Remove Algolia Admin

* Update package-lock.json

* fix package-lock

* Prepare for algoliasearch v4

* Update gitignore
  • Loading branch information
joachimesque authored Nov 25, 2023
1 parent 0eb40b1 commit 51106a0
Show file tree
Hide file tree
Showing 12 changed files with 1,132 additions and 4,590 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ yarn.lock
site/resources
.env
.DS_Store
/site/.hugo_build.lock
.hugo_build.lock
5,535 changes: 1,114 additions & 4,421 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"license": "MIT",
"dependencies": {
"algoliasearch": "^4.14.2",
"atomic-algolia": "^0.3.19",
"classnames": "^2.3.2",
"dotenv": "^16.0.3",
"instantsearch.js": "^4.49.1",
"lit-html": "^2.4.0",
"rgb-hex": "^4.0.0"
Expand Down
28 changes: 0 additions & 28 deletions site/content/outils/admin-archives/index.md

This file was deleted.

2 changes: 1 addition & 1 deletion site/layouts/pages/archives.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ <h1 class="separation separation--primary">
{{ .Content }}
</div>

<script src="{{.Site.BaseURL}}archives.js"></script>
<script src="{{.Site.BaseURL}}/js/archives.js"></script>
{{ end }}
14 changes: 0 additions & 14 deletions site/layouts/partials/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,6 @@
{{ end }}
</ul>
</li>
<li>
Outils
<ul>
{{ range .Site.Menus.outils }}
<li>
<a class="h3-like {{if or ($currentPage.IsMenuCurrent " outils " .) ($currentPage.HasMenuCurrent "outils " .) }} active{{end}}" href="{{.URL}}">
<span>
{{ .Name }}
</span>
</a>
</li>
{{ end }}
</ul>
</li>
</ul>
</div>
</div>
Expand Down
38 changes: 0 additions & 38 deletions src/js/admin-archives.js

This file was deleted.

22 changes: 0 additions & 22 deletions src/js/outils/updateArchives/fetchConferences.js

This file was deleted.

27 changes: 0 additions & 27 deletions src/js/outils/updateArchives/index.js

This file was deleted.

10 changes: 0 additions & 10 deletions src/js/outils/updateArchives/preprocessConference.js

This file was deleted.

38 changes: 14 additions & 24 deletions src/js/pages/archives/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import algoliasearch from "algoliasearch/lite";
import instantsearch from "instantsearch.js";
import { configure } from "instantsearch.js/es/widgets";
import searchBox from "./searchBox";
import refinementList from "./refinementList";
import rangeInput from "./rangeInput";
Expand Down Expand Up @@ -29,60 +30,49 @@ const initArchives = () => {
indexName: "www_programmes",
routing: true,
searchClient,
searchParameters: {
hitsPerPage: 12
}
});

search.addWidget(
search.addWidgets([
searchBox({
container: "#searchbox"
})
);
}),

configure({
hitsPerPage: 12
}),

search.addWidget(
refinementList({
container: "#themes",
attribute: "themes",
title: "Étiquettes"
})
);
}),

search.addWidget(
refinementList({
container: "#duration",
attribute: "duration",
title: "Durée"
})
);
}),

search.addWidget(
rangeInput({
container: "#year",
attribute: "year",
min: 2006,
max: new Date().getFullYear()
})
);
}),

search.addWidget(
hits({
container: "#hits",
countContainer: "#hits-count"
})
);
}),

search.addWidget(
pagination({
container: "#pagination"
})
);
}),

search.addWidget(
poweredBy({
container: "#powered-by-algolia"
})
);
}),
]);

search.start();
};
Expand Down
4 changes: 1 addition & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const webpack = require("webpack");
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
require('dotenv').config();

const getBaseUrl = (() => {
let baseUrl = process.env.HUGO_BASEURL || "/";
Expand Down Expand Up @@ -63,9 +64,7 @@ module.exports = {
plugins: [
new webpack.DefinePlugin({
"process.env": {
"NODE_ENV": JSON.stringify(process.env.NODE_ENV || "development"),
"ALGOLIA_APP_ID": JSON.stringify(process.env.ALGOLIA_APP_ID),
"ALGOLIA_ADMIN_KEY": JSON.stringify(process.env.ALGOLIA_ADMIN_KEY),
"ALGOLIA_SEARCH_ONLY_API_KEY": JSON.stringify(
process.env.ALGOLIA_SEARCH_ONLY_API_KEY
)
Expand All @@ -92,7 +91,6 @@ module.exports = {
entry: {
app: ["./js/app"],
archives: ["./js/archives"],
"admin-archives": ["./js/admin-archives"],
hub: ["./js/hub"],
hub_live: ["./js/hub_live"],
styleguide: ["./js/styleguide"],
Expand Down

0 comments on commit 51106a0

Please sign in to comment.