惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
B
Blog
月光博客
月光博客
博客园 - 【当耐特】
WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
I
InfoQ
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
Jina AI
Jina AI
博客园 - Franky
MyScale Blog
MyScale Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Last Week in AI
Last Week in AI
B
Blog RSS Feed
H
Help Net Security

🛫Qifei's Blog

通过 CC Switch 将 OpenAI 订阅额度接入 Claude Code、Hermes 与 OpenClaw 新版 Shadowrocket 配置 Tailscale,实现 iPhone、iPad 与 Mac mini 远程互联 FlyBlogAdmin:为 Hexo 打造的无数据库博客管理后台 - 🛫Qifei's Blog 用 Multica 和 Git worktree 实现多 Agent 并发开发 Markdown 格式示例大全 - 🛫Qifei's Blog Python的模块构建和调用方式 - 🛫Qifei's Blog 如何选择搭建梯子用的VPS? - 🛫Qifei's Blog 机器学习和scikit-learn库基础学习笔记 - 🛫Qifei's Blog 利用国内服务器加速v2ray访问速度和规避检查 - 🛫Qifei's Blog Matplotlib_Bar3d绘制彩色带颜色标尺的3D柱形图 - 🛫Qifei's Blog Linux后台运行nostr虚荣公钥的挖掘 - 🛫Qifei's Blog Hexo博客添加Nostr_NIP-05认证 - 🛫Qifei's Blog Nostr_NIP-05认证服务简介和配置 - 🛫Qifei's Blog Onedrive_API大文件上传记录 - 🛫Qifei's Blog 反爬虫-如何检测有没有使用Puppeteer - 🛫Qifei's Blog Vuejs学习笔记 - 🛫Qifei's Blog OpenOffice连接Mysql数据库 - 🛫Qifei's Blog 安卓ToyVPN服务端从零开始读 - 🛫Qifei's Blog 在控制器中用JS验证CSS_Selector和Xpath - 🛫Qifei's Blog RWTH自习室自动预定程序(RWTH_Lernraum) - 🛫Qifei's Blog RWTH自习室自动预定程序(RWTH_Lernraum) - 🛫Qifei's Blog 如何利用Selenium实现更加高效的爬虫 - 🛫Qifei's Blog Python如何准确的计算Http请求中的Content_Length - 🛫Qifei's Blog 破解图片等资源跨域和防盗链阻拦 - 🛫Qifei's Blog Selenium-Webdriver接口 - 🛫Qifei's Blog
Hexo博客页面引入足迹地图 - 🛫Qifei's Blog
Qifei · 2023-12-02 · via 🛫Qifei's Blog

0. 先看效果

这个地图是基于jvectormap.com制作的。地图制作,需要在hexo博客目录source路径下新建footprint文件夹。

1. 依赖下载

将jvectormap的依赖js代码和css代码下载到文件根目录。

文件路径结构形如:

1
2
3
4
5
6
7
8
9
- source
- _post
- _data
- footprint
- index.html
- jquery-jvectormap-2.0.5.css
- jquery-jvectormap-2.0.5.min.js
- jquery-jvectormap-europe-mill.js
- jquery.min.js

jquery-jvectormap下载地址在:https://jvectormap.com/download/

jquery可到jsdeliver搜索下载。

矢量地图下载地址:https://jvectormap.com/maps/world/europe/

本文以欧洲地图jquery-jvectormap-europe-mill.js 为例。

2. 地图制作

在index.html中编辑地图

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html>

<head>
<title>jVectorMap demo</title>

</head>

<body>
<div id="map" style="width: 600px; height: 400px"></div>
<script src="footprint/jquery.min.js"></script>
<link rel="stylesheet" href="footprint/jquery-jvectormap-2.0.5.css" />
<script src="footprint/jquery-jvectormap-2.0.5.min.js"></script>
<script type="text/javascript" src="footprint/jquery-jvectormap-europe-mill.js"></script>
<script>
$(function () {
$('#map').vectorMap({
map: 'europe_mill',
markerStyle: {
initial: {
fill: '#F8E23B',
stroke: '#383f47'
}
},
backgroundColor: '#383f47',
markers: [
{ latLng: [68.350273, 18.830460], name: 'Abisko, Sweden' },
{ latLng: [35.1746503, 33.3638783], name: 'Nicosia, Nicosia District, Cyprus' },
]
});
});
</script>
</body>

</html>

latLng变量是经纬度,可在网上搜索地址转经纬度的办法。

3. 博客配置

制作好地图之后,需要修改地图配置文件,来防止html代码被渲染。

打开博客根目录下的_config.yml文件,

修改skip_render的内容:

1
2
skip_render: 
- 'footprint/**/*'

4. 引用足迹地图

在配置好步骤三之后,部署的博客,应当可以使用https://yourblogsite.com/footprint的形式网址访问到地图了。

此时可以在任意post或者page直接通过添加html iframe代码嵌入地图到markdown文本中,例如,在我的about.md,关于页面的文件里,我在我想要嵌入的位置添加代码:

1
<iframe style="max-width: 100%" frameborder="no" border="0" marginwidth="0" marginheight="0" width="100%" height="400px"src="/footprint"></iframe>

部署后的页面如下:https://blog.sci.ci/about

5. 参考

Getting started

Hexo添加jVectorMap足迹地图