Skip to content

Commit

Permalink
custom marker & other changes (#31)
Browse files Browse the repository at this point in the history
add 1200x630 og logo and map

- add map marker by community locations
- theme template modified
- custom marker & other changes
  • Loading branch information
bharattech authored Jul 6, 2023
1 parent 1c4c5e2 commit 4d98f94
Show file tree
Hide file tree
Showing 7 changed files with 135 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ library = "katex" # options: "katex", "mathjax". default is "katex".
[extra.open]
enable = true
# this image will be used as fallback if a page has no image of its own
image = "rustindia.png"
image = "rustindia-og.png"
twitter_site = "rustlangin"
twitter_creator = "rustlangin"
facebook_publisher=""
Expand Down
2 changes: 1 addition & 1 deletion content/docs/sub-communities/details.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ updated = 2021-05-01T08:00:00+00:00
draft = false
weight = 10
sort_by = "weight"
template = "docs/page.html"
template = "docs/map.html"
toc = true
top = false
+++
Expand Down
Binary file added static/rustacean-flat-happy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/rustindia-og.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file removed templates
Empty file.
57 changes: 57 additions & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{%- import 'macros/head.html' as macros_head -%}
{% import 'macros/math.html' as macros_math -%}
{% import 'macros/header.html' as macros_header -%}
{% import 'macros/footer.html' as macros_footer -%}
{% import 'macros/javascript.html' as macros_js -%}
{% import 'macros/page-publish-metadata.html' as macros_publish -%}
{% import 'macros/section-navigation.html' as macros_section_nav -%}
{% import 'macros/docs-sidebar.html' as macros_sidebar -%}
{% import 'macros/docs-edit-page.html' as macros_edit_page -%}
{% import 'macros/docs-navigation.html' as macros_navigation -%}
{% import 'macros/docs-toc.html' as macros_toc -%}
<!DOCTYPE html>
<html lang="{{ config.extra.language_code | default(value="en-US") }}">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{{ macros_head::resource() }}
{{ macros_head::stylesheet() }}

{% block seo %}
{% if config.extra.title_separator %}
{% set title_separator = " " ~ config.extra.title_separator ~ " " %}
{% else %}
{% set title_separator = " | " %}
{% endif %}
{% endblock seo %}

{{ macros_head::favicons() }}
{% block math %}{{ macros_math::math() }}{% endblock math %}

<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
crossorigin=""/>
<!-- Make sure you put this AFTER Leaflet's CSS -->
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="
crossorigin=""></script>
<style>
#map { height: 600px;margin-top: 160px; }
</style>
</head>
{% block body %}{% set page_class="home" %}{% endblock body %}
<body class="{{ page_class }}">
{% block header %}
{{ macros_header::header(current_section="/") }}
{% endblock header %}

{% block content %}{% endblock content %}

{% block footer %}
{{ macros_footer::footer() }}
{% endblock footer %}

{{ macros_js::javascript() }}
</body>
</html>
76 changes: 76 additions & 0 deletions templates/docs/map.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{% extends "page.html" %}

{% block body %}
{% set page_class = "docs single" %}
{% endblock body %}

{% block header %}
{# This value is matched by the config.extra.menu.main~url #}
{% set current_section = "docs" %}
{{ macros_header::header(current_section=current_section)}}
{% endblock header %}

{% block content %}
<div class="wrap container" role="document">
<div class="container">
<div class="row align-items-start">
<div class="col">
<h1>{{ page.title }}</h1>
</div>
</div>
<div class="row justify-content-center">
<div class="col">
{% if page.extra.lead %}<p class="lead">{{ page.extra.lead | safe }}</p>{% endif %}

{{ page.content | safe }}

{% if config.extra.edit_page %}
{{ macros_edit_page::docs_edit_page(current_path=current_path) }}
{% endif %}
</div>
<div class="col">

<div id="map" ></div>
<script>

const map = L.map('map', {
dragging: false,
scrollWheelZoom: false
}).setView([20.5937, 78.9629], 5);

L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);

var rustaceanIcon = L.icon({
iconUrl: '/rustacean-flat-happy.png',
iconSize: [45, 30], // size of the icon
});

const puneMarker = L.marker([18.5204, 73.8567], {icon: rustaceanIcon}).addTo(map);
puneMarker.bindPopup("<b>Hello world!</b><br>Welcome to <b>Rust Pune.</b>");
const keralaMarker = L.marker([10.1632, 76.6413], {icon: rustaceanIcon}).addTo(map);
keralaMarker.bindPopup("<b>Hello world!</b><br>Welcome to <b>Rust Kerala.</b>");
const bengaluruMarker = L.marker([12.9716, 77.5946], {icon: rustaceanIcon}).addTo(map);
bengaluruMarker.bindPopup("<b>Hello world!</b><br>Welcome to <b>Rust Bengaluru.</b>");
const hyderabadMarker = L.marker([17.3850, 78.4867], {icon: rustaceanIcon}).addTo(map);
hyderabadMarker.bindPopup("<b>Hello world!</b><br>Welcome to <b>Rust Hyderabad.</b>");
const delhiMarker = L.marker([28.7041, 77.1025], {icon: rustaceanIcon}).addTo(map);
delhiMarker.bindPopup("<b>Hello world!</b><br>Welcome to <b>Rust Delhi.");
const mumbaiaMarker = L.marker([19.0760, 72.8777], {icon: rustaceanIcon}).addTo(map);
mumbaiaMarker.bindPopup("<b>Hello world!</b><br>Welcome to <b>Rust Mumbai.</b>");
const chandigarhMarker = L.marker([30.7333, 76.7794], {icon: rustaceanIcon}).addTo(map);
chandigarhMarker.bindPopup("<b>Hello world!</b><br>Welcome to <b>Rust Chandigarh.</b>");
</script>

</div>
</div>
<div class="row align-items-start">
<div class="col mb-5">
{{ macros_navigation::docs_navigation(page=page, current_section=current_section) }}
</div>
</div>
</div>
</div>
{% endblock content %}

0 comments on commit 4d98f94

Please sign in to comment.