Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/github_actions/actions/setup-no…
Browse files Browse the repository at this point in the history
…de-4
  • Loading branch information
nemesifier authored Nov 4, 2024
2 parents 54c518c + 9a15c30 commit d36e540
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 5 deletions.
15 changes: 12 additions & 3 deletions content/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@
<div class="container is-fullhd">
<section class="hero is-small has-text-centered">
<div class="hero-body pt-1">
<p class="subtitle is-spaced">
<a href="{filename}features.html#node-management" class="rounded">
<p class="subtitle is-spaced" id="top-feature-container">
<a
id="top-feature-link"
href="#node-management"
class="rounded"
style="display: none;"
>
<span class="rounded light-bg"> Top feature </span>
Automatic VPN provisioning
<span id="top-feature-title">Automatic VPN provisioning</span>
<i class="fas fa-arrow-right"></i>
&nbsp;
</a>
Expand Down Expand Up @@ -459,5 +464,9 @@ <h2 class="title is-size-3 is-size-4-mobile is-spaced">Try the demo</h2>
</p>
</div>
</section>
<script>
const featuresBasePath = "{{ SITEURL }}/features/";
</script>
<script src="{{ SITEURL }}/theme/js/index-top-feature.js"></script>
</body>
</html>
3 changes: 3 additions & 0 deletions css/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ body {
p.button-container .button {
margin: 5px;
}
#top-feature-container {
min-height: var(--km);
}
.rounded {
padding: 0.6em 0.4em;
border-radius: 20px;
Expand Down
82 changes: 82 additions & 0 deletions js/index-top-feature.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
const features = [
{
title: "Configuration Templates",
href: "#templates-and-variables",
},
{
title: "Automatic Provisioning",
href: "https://openwisp.io/docs/dev/openwrt-config-agent/user/automatic-registration.html",
},
{
title: "Automatic VPN Tunnels",
href: "#automatic-vpn-tunnels",
},
{
title: "Network Monitoring",
href: "#network-monitoring",
},
{
title: "Alerts & Notifications",
href: "#notifications",
},
{
title: "Multi-tenancy",
href: "#multi-tenancy",
},
{
title: "Firmware Upgrades",
href: "#firmware-upgrades",
},
{
title: "Network Topology",
href: "#network-topology",
},
{
title: "WiFi & Roaming",
href: "#wifi-and-roaming",
},
{
title: "Hotspots & Public WiFi",
href: "#hotspot-and-public-wifi",
},
{
title: "Mesh Networks",
href: "#mesh-networks",
},
{
title: "RADIUS & EAP",
href: "#radius-eap",
},
{
title: "IPAM",
href: "#ipam",
},
{
title: "Modular, Programmable, Extensible",
href: "https://openwisp.io/docs/dev/general/values.html#software-reusability-for-long-term-sustainability",
},
{
title: "Great Docs",
href: "https://openwisp.io/docs/dev/",
},
];

// Function to update the "Top Feature" section
function setRandomTopFeature() {
// Select a random feature from the map
const randomFeature = features[Math.floor(Math.random() * features.length)];

// Update the Top Feature link with the selected feature's data
const topFeatureTitle = document.getElementById("top-feature-title");
topFeatureTitle.textContent = randomFeature.title;

const topFeatureLink = document.getElementById("top-feature-link");
if (randomFeature.href.startsWith("#")) {
randomFeature.href = featuresBasePath + randomFeature.href;
}
topFeatureLink.href = randomFeature.href;
topFeatureLink.style.display = "unset";
}

// Wait for the document to load before updating the Top Feature section
document.addEventListener("DOMContentLoaded", setRandomTopFeature);
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"minify:theme": "terser theme/static/js/theme.js --config-file .terserrc -o theme/static/js/theme.min.js",
"minify:faq": "terser theme/static/js/faq.js --config-file .terserrc -o theme/static/js/faq.min.js",
"minify:modal": "terser theme/static/js/modal.js --config-file .terserrc -o theme/static/js/modal.min.js",
"minify": "npm run minify:activity && npm run minify:theme && npm run minify:faq && npm run minify:modal",
"minify:top-feature": "terser theme/static/js/index-top-feature.js --config-file .terserrc -o theme/static/js/index-top-feature.min.js",
"minify": "npm run minify:activity && npm run minify:theme && npm run minify:faq && npm run minify:modal && npm run minify:top-feature",
"build": "npm run build:css && npm run build:js && npm run minify",
"serve": "http-server -a 0.0.0.0 -p 8080 ./output/",
"start": "concurrently \"npm run serve\" \"npm run build:sass\" \"npm run build:postcss\"",
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pelican~=4.9.1
pelican~=4.10.1
pelican-jinja2content~=1.0.1
pelican-minify~=2.0.0
pelican-sitemap~=1.1.0
Expand Down

0 comments on commit d36e540

Please sign in to comment.